<%@ include file="/common/taglibs.jsp"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>Job Trigger</TITLE>
</HEAD>

<SCRIPT language=JavaScript type=text/javascript>
function addSchedule() {
	window.location = document.forms[0].action 
			+ "?method=edit&subId=<bean:write name='jobSchedForm' property='subId' />&jobName=<bean:write name='jobSchedForm' property='jobName' />&subVersion=<bean:write name='jobSchedForm' property='subVersion' />";
}


function searchSub() {
	with(document.forms[0]) {
	//	if(jobName.selectedIndex == 0) {
	//		alert("Please select job!");
	//		return false;
	//	}

		window.location = action + "?method=list&jobName=" + jobName.options[jobName.selectedIndex].value;
	}
}

function Search() {
	with(document.forms[0]) {
		window.location = action + "?method=list&jobName=" + jobName.options[jobName.selectedIndex].value;
	}
}
</SCRIPT>

<link rel="stylesheet" href="<%=ctxPath%>/Css/style.css" type="text/css">

<html:form action="jobSubAction.do" method="get">
<html:hidden name="jobSchedForm" property="id"/>

<html:hidden name="jobSchedForm" property="subId"/>
<!--html:hidden name="jobSchedForm" property="version"/-->


<b><br><bean:message key="global.jobsub.listpage.title" />
<br><br><br>
<div align="center">

<table border="0" style="border-collapse: collapse" width="50%" id="table1" cellspacing="1">
	<tr>
		<td width="130">
		<p align="center"><font color="#003399"> <b><bean:message key="global.jobsub.jobs"/></b></font>
		</td>		

		<td width="*">
			<html:select name="jobSchedForm" property="jobName" onchange="Search();">
				<html:options collection="jobs" labelProperty="desc" property="jobName" />
			</html:select>&nbsp;&nbsp;&nbsp;
			<html:button property="method" titleKey="button.search" styleClass="button" onclick="return searchSub();"><bean:message key="button.search"/></html:button>
		</td>		
	</tr>
	
	<tr>
		<td colspan="2" height="20"/>
	</tr>

	<tr>
		<td colspan="2" height="22"><bean:message key="global.jobsub.schedules" /></td>
	</tr>

</table>

<table width="50%">
<tr><td align="right">
<logic:notEmpty name="jobSchedForm" property="jobName">
<html:button property="method" titleKey="button.add" styleClass="button" onclick="addSchedule();"><bean:message key="button.add"/></html:button>
</logic:notEmpty>
</td></tr>

<tr><td>
<table border="1" class="tablestytle" width="100%" id="table1" cellspacing="1">
	<tr class="table_title">
	    <td width="10"></td>
		<td width="110"><bean:message key="global.jobsub.schduleDesc"/></font>
		</td>

		<td width="110"><bean:message key="global.jobsub.scheduleType"/></font>
		</td>
	</tr>
	<% int i=0; %>
	<logic:present name="list">
	<logic:iterate id="sched" name="list">
		<tr>
		    <td><%= ++i %></td>
			<TD><b>
				<html:link action="/jobSubAction.do?method=edit" paramId="id" paramName="sched" paramProperty="id">
					<bean:write name="sched" property="desc"/></html:link>
				</b>
			</TD>
			<TD><bean:write name="sched" property="typeName"/></TD>
		</tr>
	</logic:iterate> 
	</logic:present>  
</table>
</td></tr>
</table>
</div>



<p><font color="#336699" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></p>
<p align="center">&nbsp;</p>
</html:form>


</b>


</BODY>
</HTML>